package com.zmc.third.application.factory;

import com.zmc.third.application.factory.service.alipay.AlipayService;
import com.zmc.third.application.factory.service.alipay.OrderPayPayServiceImpl;
import com.zmc.third.application.factory.service.alipay.WebsitePayServiceImpl;
import com.zmc.third.infrastructure.enums.PayEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author：zmc
 * @Date：2024/11/9 10:09
 * 支付类型
 */

@Component
public class PayTypeFactory {

    @Autowired
    private OrderPayPayServiceImpl orderPayPayService;

    @Autowired
    private WebsitePayServiceImpl websitePayService;

    public AlipayService getPayType(String type) {
        if (PayEnum.PAY_TYPE_ORDER_CODE.getCode().equals(type)) {
            return orderPayPayService;
        }
        return websitePayService;
    }


}
